<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>My JSP 'boollist.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" type="text/css" href="css/common.css">

	</head>

	<body>
		<div id="admin_booktype">
			<s:form action="jsp_admin_booktypeadd.action" method="post"
				theme="simple">
				<table>
					<tr>
						<td>新增分类：</td>
						<td>
							<s:textfield name="typeName"></s:textfield>
						</td>
						<td><s:submit value="增加"></s:submit></td>
					</tr>
				</table>
			</s:form>
			<table id="booktypelist">
				<tr id="list_title">
					<th>分类名称</th><th>所含书目</th><th>处理</th>
				</tr>
				<s:iterator value="%{typeList}">
					<s:if test="%{typeId!=0}">
						<tr>
							<td>
								<s:property value="typeName" />
							</td>
							<td>
								<s:property value="bookCount" />
							</td>
							<td>
								<a
									href="jsp_admin_booktypedelete.action?typeId=<s:property value='typeId' />">删除</a>
							</td>
						</tr>
					</s:if>
				</s:iterator>
				<s:if test="%{size==0}">
					<tr>
						<td colspan="3">
							没有分类
						</td>
					</tr>
				</s:if>
			</table>
		</div>
	</body>
</html>
